/*
 * Manager.cpp
 *
 *  Created on: 2012/02/05
 *      Author: takedanaoki
 */

#include "Stdafx.h"
#include "NTEngine/Net/Manager.h"
#include "Net/src/ManagerImpl.h"

namespace NTEngine {
namespace Net {

ManagerImpl* gManagerImpl = 0;

Manager Manager::instance() {
	ASSERT( gManagerImpl && "Net Module hasn't started yet!" );
	return Manager();
}

void Manager::enableHaltOnError( bool f ) {
	gManagerImpl->enableHaltOnError( f );
}

void Manager::setTimeout( int sec ) {
	gManagerImpl->setTimeout( sec );
}

int Manager::totalSize() const {
	return gManagerImpl->mTotalSize;
}

void Manager::create() {
	HARD_ASSERT( gManagerImpl == 0 );
	gManagerImpl = NEW ManagerImpl();
}

void Manager::destroy() {
	SAFE_DELETE( gManagerImpl );
}

} // namespace Net
} // namespace NTEngine
